/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ca.ubc.icapture.genapha.actions;

import ca.ubc.icapture.genapha.forms.RedirectForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

/**
 *
 * @author BTripp
 */
public class RedirectAction extends Action {
    
    public RedirectAction(){
        super();
    }
    


    @Override
    public ActionForward execute(
		ActionMapping mapping,
		ActionForm Form,
		HttpServletRequest request,
		HttpServletResponse response)
		throws Exception {

        //ActionForward forward = new ActionForward();
        //HttpSession session = request.getSession();
        RedirectForm form = (RedirectForm) Form;
        //perform what you need to

        //Then redirect
        response.sendRedirect(form.getURL());

        //pass null to struts.
        return null;

    } 
}